# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "i关爱重症海外医疗保险"

    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):
            if item["payObject"] == "1":
                payObject = "本人"
            elif item["payObject"] == "2":
                payObject = "父母"
            elif item["payObject"] == "3":
                payObject = "配偶"
            else:payObject = "子女"

            data["name"] = self.name
            data["company"] = "信美相互保险"
            data["year"] = item["year"]
            data["gender"] = "1" if item["gender"] == "M" else "0"
            data["payObject"] = payObject
            data["money"] = item["money"]
            data["expire"] = item["expire"]
            data["payType"] = "年缴"
            data["price"] = item["price"]
            Helper.mergeTable(self.name, self.mysql, data)